{% extends 'Base/main.content.lists.div.html.twig' %}
{% import 'Base/list_item.twig' as listItem %}
 {% block addBtn %}
     <a href="{{ urls.addUrl is defined ? urls.addUrl : '' }}?cat={{ cat }}">
         <div class="layui-btn layui-btn-normal"><span class="fa fa-plus"></span> 新增</div>
     </a>
 {% endblock %}
{% block options %}
    <div class="menu-list">
        {#{{ dump(tools) }}#}
        <input type="hidden" name="cat" value="{{ cat }}">
        {% for key , classes in tools %}
            {% set default = "请选择分类" %}
            {% set classes = classes %}
            <div class="rule-single-select layui-inline">
                <select name="cond[{{ key }}]" onchange="javascript:__doPostBack('searchCond','')" >
                    <option value="" {{app.request.get("cond")[key] is defined and app.request.get("cond")[key] == "" ? ' selected="selected"' : "" }} >{{ default }}</option>
                    {% for class in classes %}
                        <option value="{{ class.id }}"
                                {{app.request.get("cond")[key] is defined and  app.request.get("cond")[key] == class.id ? ' selected="selected"' : "" }}
                        >{{ class.name }}</option>
                    {% endfor %}
                </select>
            </div>
        {% endfor %}
    </div>
{% endblock %}
{% block tableHead %}
    <tr>
        <th align="" width="">选择</th>
        <th align="" width="">#</th>
        <th align="" width="">栏目</th>
        <th align="" width="">标题</th>
        <th align="" width="">图片</th>
        {#<th align="" width="">内容</th>#}
        {#<th align="" width="">创建时间</th>#}
        {#<th align="" width="">adddate</th>#}
        {#<th align="" width="">updatetime</th>#}
        {#<th align="" width="">updatedate</th>#}
        <th align="" width="">置顶</th>
        <th align="" width="">热门</th>
        {#<th align="" width="">首页</th>#}
        <th align="" width="">浏览量</th>
        {#<th align="" width="">附件</th>#}
        {#<th align="" width="">author</th>#}
        {#<th align="" width="">src</th>#}
        {#<th align="" width="">tags</th>#}
        <th align="" width="">时间</th>
        <th align="" width="">操作</th>
    </tr>
{% endblock %}
{% block tableList %}
    {% for Entity in lists %}
        <tr>
            <td align='' width=''>
                <span class="checkall"><input lay-skin="primary" type="checkbox" name="ids[]" value="{{ Entity.Art_id }}"/></span>
            </td>
            <td align='' width='' id='category_{{ Entity.Art_id }}'>
                {{ listItem.text('id',Entity.Art_id,Entity.Art_id) }}
            </td>
            <td align='' width='' id='category_{{ Entity.Art_id }}'>
                {{ listItem.text('category',Entity.ArtCategory_name,Entity.Art_id) }}
            </td>
            <td align='' width='' id='title_{{ Entity.Art_id }}'>
                {{ listItem.text('title',Entity.Art_title,Entity.Art_id) }}
            </td>
            <td align='' width='' id='pic_{{ Entity.Art_id }}'>
                {{ listItem.pic('pic',Entity.Art_pic,Entity.Art_id) }}
            </td>
            {#<td align='' width='' id='content_{{ Entity.Art_id }}'>#}
                {#{{ listItem.article('content',Entity.Art_content,Entity.Art_id) }}#}
            {#</td>#}
            {#<td align='' width='' id='addtime_{{ Entity.Art_id }}'>#}
                {#{{ listItem.text('addtime',Entity.Art_addtime,Entity.Art_id) }}#}
            {#</td>#}
            {#<td align='' width='' id='adddate_{{ Entity.Art_id }}'>#}
                {#{{ listItem.text('adddate',Entity.Art_adddate,Entity.Art_id) }}#}
            {#</td>#}
            {#<td align='' width='' id='updatetime_{{ Entity.Art_id }}'>#}
                {#{{ listItem.text('updatetime',Entity.Art_updatetime,Entity.Art_id) }}#}
            {#</td>#}
            {#<td align='' width='' id='updatedate_{{ Entity.Art_id }}'>#}
                {#{{ listItem.text('updatedate',Entity.Art_updatedate,Entity.Art_id) }}#}
            {#</td>#}
            <td align='' width='' id='is_Top_{{ Entity.Art_id }}'>
                {{ listItem.switch('is_Top',Entity.Art_is_Top,Entity.Art_id) }}
            </td>
            <td align='' width='' id='is_Hot_{{ Entity.Art_id }}'>
                {{ listItem.switch('is_Hot',Entity.Art_is_Hot,Entity.Art_id) }}
            </td>
            {#<td align='' width='' id='is_Index_{{ Entity.Art_id }}'>#}
                {#{{ listItem.switch('is_Index',Entity.Art_is_Index,Entity.Art_id) }}#}
            {#</td>#}
            <td align='' width='' id='scan_{{ Entity.Art_id }}'>
                {{ listItem.text('scan',Entity.Art_scan,Entity.Art_id) }}
            </td>
            {#<td align='' width='' id='files_{{ Entity.Art_id }}'>#}
                {#{{ listItem.files('files',Entity.Art_files,Entity.Art_id) }}#}
            {#</td>#}
            {#<td align='' width='' id='author_{{ Entity.Art_id }}'>#}
                {#{{ listItem.text('author',Entity.Art_author,Entity.Art_id) }}#}
            {#</td>#}
            {#<td align='' width='' id='src_{{ Entity.Art_id }}'>#}
                {#{{ listItem.text('src',Entity.Art_src,Entity.Art_id) }}#}
            {#</td>#}
            {#<td align='' width='' id='tags_{{ Entity.Art_id }}'>#}
                {#{{ listItem.text('tags',Entity.Art_tags,Entity.Art_id) }}#}
            {#</td>#}
            <td class="c12" align='' width='' id='intro_{{ Entity.Art_id }}'>
                {#{{ listItem.text('intro',Entity.Art_intro,Entity.Art_id) }}#}
                <p>创建时间：{{ listItem.day('addtime',Entity.Art_adddate,Entity.Art_id) }}</p>
                <p>更新时间：{{ listItem.day('updatetime',Entity.Art_updatedate,Entity.Art_id) }}</p>
            </td>
            <td align='' width=''>
                {#{{ listItem.edit('Art','',Entity.Art_id) }}#}
                <div class="layui-btn-group">
                    <a href="{{ path('Art' ~ "PreEdit",{'id':Entity.Art_id,"cat":cat}) }}" class="layui-btn layui-btn-normal layui-btn-sm"><span class="fa fa-edit c13"></span></a>
                </div>
                {{ listItem.copy('Art','',Entity.Art_id) }}
            </td>
        </tr>
    {% endfor %}
{% endblock %}
{% block script %}
{% endblock %}

